package StudyCode.summary.jarfile;

import java.io.IOException;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.jar.JarFile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class GetJarFileUsingURL {
	public static void main(String[] args) {
		try {
			URL url = new URL("jar:file:/E:/Copy/1.jar!/");
			JarURLConnection conn = (JarURLConnection) url.openConnection();
			JarFile jarfile = conn.getJarFile();
			String entryName = conn.getEntryName();
			System.out.println(jarfile.getName());
			System.out.println(entryName);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
